import { ref, computed } from 'vue';
export const list = ref([
    { url: 'http://music.lyhotel.group/uploads/uploads/20230915/e8a6edb9bf9cc9669f96045301dd588f.mp3', author: '作者', name: '默认', image: 'http://music.lyhotel.group/uploads/uploads/20231113/2211a42ae5c48f6da26350f290e46a5d.png' }
]);
export const current = ref(0);
export const mode = ref('single'); //single单曲循环  random 随机播放   next 顺序播放 


export const currentMusic = computed(() => {
    return list.value.at(current.value % list.value.length);
})

export const add = function (music) {
    list.value.unshift(music);
    current.value = 0;
};